package operation.iterator.obj.aggregates;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import operation.iterator.abs.ICollege;
import operation.iterator.obj.Department;
import operation.iterator.obj.iterators.ArtCollegeIterator;

public class ArtCollege implements ICollege {

    List<Department> departments;

    public ArtCollege() {
        departments = new ArrayList<>();
        departments.add(new Department("Drawing Department"));
        departments.add(new Department("Sculpture Department"));
    }

    @Override
    public Iterator<Department> iterator() {
        return new ArtCollegeIterator(departments);
    }

    @Override
    public void addDepartment(String name) {
        departments.add(new Department(name));
    }
}